package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * UserMapper
 *
 * @author liliudong
 * @version 1.0
 * @description
 * @date 2023/6/25 13:59
 */
@Mapper
public interface UserMapper {
    /**
     * 根据openid查询
     *
     * @param openid
     * @return
     */
    @Select("select * from user where openid = #{openid}")
    User selectByOpenid(String openid);

    /**
     * 新增用户
     *
     * @param user
     */
    void insert(User user);

    @Select("select * from user where id = #{userId}")
    User selectByUserId(Long userId);
}
